
package com.starshineworks.servlets;

import com.starshineworks.util.Util;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet(name = "CreateField", urlPatterns = {"/CreateField"})
public class CreateField extends HttpServlet {
        
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException 
    {
        Util.showForm(request, response, "CreateField", true, true, true);
    }

    // the multi-part form requires the post servlet to be the same as the get
    // servlet from which the form was submitted. Cannot use dispatcher.
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException 
    {
        Util.serveForm(request, response, this, "CreateField");
    }
    
}
    